var express = require('express');
var router = express.Router();
let { addClassifys, getClassifys, deleteClassifys, modifyClassifys } = require('../service/classifysService')
/* GET home page. */
router.get('/', function (req, res, next) {
  res.render('index', { title: 'Express' });
});
//新增保险项目
router.post('/addClassifys', async function (req, res) {
  let data = await addClassifys(req.body);
  res.send(data)
})
//获取保险项目
router.get('/getClassifys', async function (req, res) {
  let data = await getClassifys(req.query);
  res.send(data)
})
//删除保险项目
router.post('/deleteClassifys', async function (req, res) {
  let data = await deleteClassifys(req.body);
  res.send(data)
})
//修改保险名称
router.post('/modifyClassifys', async function (req, res) {
  let data = await modifyClassifys(req.body);
  res.send(data)
})

module.exports = router;
